const Koa = require('koa');
const Router = require('koa-router');
const static = require('koa-static');
const views = require('koa-views');

const app = new Koa();
const router = new Router();

app.use(static(__dirname));
app.use(views(__dirname, {
  extension: 'html'
}));

router.get('/checkUserName', (ctx, next) => {
  ctx.body = 'hello';
});

router.get('/ajax', async (ctx, next) => {
  await ctx.render('ajax.html');
})

app.use(router.routes());

app.listen(3000);
